/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.restaurant.facade;

import com.restaurant.entities.ProductsInOrders;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Dexter
 */
@Stateless
public class ProductsInOrdersFacade extends AbstractFacade<ProductsInOrders> implements ProductsInOrdersFacadeLocal {
    @PersistenceContext(unitName = "com.restaurant_Restaurant_ZPHE-ejb_ejb_1.0-SNAPSHOTPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public ProductsInOrdersFacade() {
        super(ProductsInOrders.class);
    }
    
    @Override
    public void create(ProductsInOrders entity) {
        getEntityManager().persist(entity);
    }
    
    @Override
    public void edit(ProductsInOrders entity) {
        getEntityManager().merge(entity);
    }
}
